﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BSCMFF.Core.DataAccessLayer;

namespace BSCMFF.Web.UserControls.Evaluation
{
    /// <summary>
    /// Assign employee evaluator.
    /// </summary>
    /// <remarks></remarks>
    public partial class AssignEmployeeEvaluator : System.Web.UI.UserControl
    {
        /// <summary>
        /// Gets or sets the evaluator assigned ID.
        /// </summary>
        /// <value>The evaluator assigned ID.</value>
        /// <remarks></remarks>
        public int EvaluatorAssignedID { get; set; }
        /// <summary>
        /// employee
        /// </summary>
        private User _employee;

        /// <summary>
        /// Gets or sets the employee.
        /// </summary>
        /// <value>The employee.</value>
        /// <remarks></remarks>
        public User Employee
        {
            get
            {
                if (_employee == null)
                {
                    _employee = new User();
                }
                return _employee;
            }
            set
            {
                _employee = value;
            }
        }

        /// <summary>
        /// Gets or sets the EEEID.
        /// </summary>
        /// <value>The EEEID.</value>
        /// <remarks></remarks>
        public int EEEID { get; set; }

        /// <summary>
        /// Gets or sets the evaluator ID.
        /// </summary>
        /// <value>The evaluator ID.</value>
        /// <remarks></remarks>
        public int? EvaluatorID 
        { 
            get
            {
                return ESS.SelectedUserID;
            }
            set
            {
                if (value != null)
                {
                    ESS.SelectedUserID = value;
                }
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether [button delete visible].
        /// </summary>
        /// <value><c>true</c> if [button delete visible]; otherwise, <c>false</c>.</value>
        /// <remarks></remarks>
        public bool ButtonDeleteVisible 
        { 
            get
            {
                return LinkButtonDelete.Visible;
            }
            set
            {
                LinkButtonDelete.Visible = value;
            }
        }

        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// Occurs when [link button delete event].
        /// </summary>
        /// <remarks></remarks>
        public event EventHandler LinkButtonDeleteEvent;
        /// <summary>
        /// Handles the Click event of the LinkButtonDelete control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        protected void LinkButtonDelete_Click(object sender, EventArgs e)
        {
            //this.Visible = false;
            if (LinkButtonDeleteEvent != null)
            {
                LinkButtonDeleteEvent(this, e);
            }
        }        
    }
}